﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:local="clr-namespace:ArchX.Controls"
					>

	<Style x:Key="{x:Type local:Ruler}" TargetType="{x:Type local:Ruler}">
		<Setter Property="HorizontalAlignment" Value="Stretch"/>
		<Setter Property="VerticalAlignment" Value="Stretch"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:Ruler}">
					<AdornerDecorator>
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>
							<local:RulerCorner x:Name="PART_CRuler" />
							<local:RulerBarHorizontal x:Name="PART_HRuler" Grid.Column="1" />
							<local:RulerBarVertical x:Name="PART_VRuler" Grid.Row="1" />
							<ScrollViewer x:Name="PART_ScrollViewer" CanContentScroll="True"
									  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
									  Grid.Column="1" Grid.Row="1">
							</ScrollViewer>
						</Grid>
					</AdornerDecorator>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="ContextMenu">
			<Setter.Value>
				<ContextMenu DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}">
					<MenuItem Header="Is protected" IsCheckable="True" IsChecked="{Binding IsProtected}" />
					<!--<MenuItem Header="Is visible" IsCheckable="True" IsChecked="{Binding IsProtected}" />-->
					<Separator />
					<MenuItem Header="Show guides" IsCheckable="True" IsChecked="{Binding ShowGuides}" />
					<MenuItem Header="Show mouse position" IsCheckable="True" IsChecked="{Binding ShowMousePosition}" />
					<Separator />
					<MenuItem Header="Guides">
						<MenuItem Header="Edit guides" Command="{Binding EditGuidesCommand}" />
						<Separator />
						<MenuItem Header="Show all" IsCheckable="True" Command="{Binding ShowAllCommand}" />
						<MenuItem Header="Lock all" IsCheckable="True" Command="{Binding LockAllCommand}"/>
						<MenuItem Header="Snap all" IsCheckable="True" Command="{Binding SnapAllCommand}"/>
					</MenuItem>
				</ContextMenu>
			</Setter.Value>
		</Setter>
	</Style>
	
</ResourceDictionary>